<template>
  <div id="ueditor"></div>
<!--  <VueUeditorWrap v-model="msg" :config="myConfig"/>-->
</template>

<script>
  import '@/config.js'
  import '@/utf8-jsp/ueditor.config.js'
  import '@/utf8-jsp/ueditor.all.js'
  import '@/utf8-jsp/lang/zh-cn/zh-cn.js'
  import '@/utf8-jsp/ueditor.parse.js'
  // import VueUeditorWrap from 'vue-ueditor-wrap'


  export default {
    // components: {VueUeditorWrap},
  props: {
  },
    mounted() {
      // console.log('ue---',UE),window.UEDITOR_CONFIG
      this.ue = UE.getEditor('container');
      this.ue.ready(()=>{
        this.ready = true
      });
    },
    data() {
    return {
      ue: {},
      ready: false,
    };
  },
  methods: {
    setContent(content) {
      this.ready?this.ue.setContent(content):new Error('编辑器初始化中...')
    },
    getContent() {
      this.ready?this.ue.ue.getContent():new Error('编辑器初始化中...')
    },
    //返回纯文本
    getContentTxt() {
      return this.ready?this.ue.getContentTxt():new Error('编辑器初始化中...');
    }

  },
};
</script>

<style>
  #ueditor {
    width: 100%;
    height: 400px;
  }
</style>